<?php

// [ BP ]

namespace app\index\controller;
use app\index\controller\Base;
use think\Session;

class Bp extends Base
{
    // 前置操作
    protected $beforeActionList = [
        'must_cyz' => [
            'only' => ['index','create','upload'],
        ],
    ];

    // 必须为创业者
    protected function must_cyz()
    {
        ( 1 == Session::get('member.role') ) || $this->redirect('@error/forbidden');
    }

    // ----------------------------------------------------------------------------

    // 智能BP
    // http://jzl.51dojob.com/bp
    public function index()
    {
        return $this->fetch();
    }

    // 创建BP
    // http://jzl.51dojob.com/bp/create/ID
    public function create()
    {
        $id = $this->request->get('id/d',0);

        $this->assign('id',$id);

        return $this->fetch();
    }

    // BP详情
    // http://jzl.51dojob.com/bp/ID
    public function read()
    {
        $id = $this->request->get('id/d',0);

        $this->assign('id',$id);

        return $this->fetch();
    }

    // 上传BP
    // http://jzl.51dojob.com/bp/upload
    public function upload()
    {
        return $this->fetch();
    }
}